<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCourseQuestionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('course_questions', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('course_id') ->default(0) ->comment('课程id');
            $table->string('question')      ->default('')->comment('问题');
            $table->integer('sort')         ->default(0) ->comment('排序');
            $table->integer('integral')     ->default(0) ->comment('答对获得的积分');
            $table->integer('limit_num')    ->default(0) ->comment('限制答题次数');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::dropIfExists('course_questions');
    }
}
